package com.example.novelstory.controller.dxy;

import com.example.novelstory.entity.VipUser;
import com.example.novelstory.service.dxy.VipServicelmpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * author:daixiaoyi
 */

@Api(tags ="vip管理")
@CrossOrigin
@RestController
public class VipController {
    @Resource
    VipServicelmpl vipService;

    @PostMapping(value = "/findVipAll")
//    @ResponseBody
    @ApiOperation(value = "全查2")
    public List<VipUser> findVipAll() {
//        List<VipUser> allVipUser = vipService.findVipAll();
        return vipService.findVipAll();
    }

//    @ResponseBody
    @PostMapping(value = "/addVip")
    @ApiOperation(value = "增加2")
    public Boolean addVipInfo(VipUser vipUser) {
//        List<VipUser> addVipInfo = vipService.addVipInfo(username,password,sex,email,introduce,province,city,country,headimgurl,status,login,login_ip,login_time,exp,intrgral,create_time,update_time,recommend,viplevel,recharge);
        return vipService.addVipInfo(vipUser);

    }

//    @ResponseBody
    @PostMapping(value = "/deleteVip")
    @ApiOperation(value = "删除2")
    public Boolean deleteVipInfo(int id) {
//        List<VipUser> deleteVipInfo = vipService.deleteVipInfo(id);
        return vipService.deleteVipInfo(id);

    }

//    @ResponseBody
    @PostMapping(value = "/updeteVip")
    @ApiOperation(value = "修改2")
    public Boolean updeteVipInfo(VipUser vipUser) {
//        List<VipUser> updeteVipInfo = vipService.updeteVipInfo(username,password,sex,email,introduce,province,city,country,headimgurl,status,login,login_ip,login_time,exp,intrgral,create_time,update_time,recommend,viplevel,recharge);
      return vipService.updeteVipInfo(vipUser);
    }
}
